package com.yingdong.gateserver.innter.service;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.yingdong.db.DBManager;

public class ConfigService {
	static Log logger = LogFactory.getLog(ConfigService.class);
	private static Properties prop = new Properties();

	public static void init()  {
		try {
			File f = new File("conf/serverconfig.properties");
			InputStream in = new FileInputStream(f);
			prop.load(in);
		} catch (IOException e) {

			logger.error("", e);
		}
	}

	public static int getPropertyInt(String key) {
		return Integer.decode(prop.getProperty(key));
	}

	public static String getPropertyString(String key) {
		return prop.getProperty(key);
	}
}
